<script>
	var pnum = {$pnum};
	{if condition="!isset($search)"}
	var search = 0;
	var goUrl = "/{$Request.module}/shop_store/lst.html?page="+pnum;
	var addUrl = "{:url('ad/add')}";
	{else/}
	var search = {$search};
	var goUrl = "/{$Request.module}/shop_store/search.html?page="+pnum;
	var addUrl = "{:url('shop_store/add')}";
	{/if}

	$(function(){
		$("#checkAll").click(function () {
	        $("input[class='text_id']:checkbox").prop("checked", this.checked);
	    }); 
	});
</script>                          
                        
                        <table class="table table-hover table-bordered">
                            <thead>
                                <tr>
                                    <th style="width:5%"><input type="checkbox" id="checkAll"/></th>
                                    <th style="width:20%">门店名称</th>
                                    <th style="width:20%">门店logo</th>
                                    <th style="width:15%">电话</th>
                                    <th style="width:5%">联系人</th>
                                    <th style="width:5%">添加时间</th>
                                    <th style="width:5%">是否开启</th>
                                    <th style="width:15%">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                            {if condition="$list->isEmpty() == false"}
							{foreach name="list" item="v"}
                                <tr>
                                    <td><input type="checkbox" class="text_id" name="id[]" value="{$v.id}" /></td>
                                    <td>{$v.name}</td>
                                    <td><img src="{$v.logo}" style="max-width: 200px; max-height: 100px;" alt=""></td>
                                    <td>{$v.phone}</td>
                                    <td>{$v.contact}</td>
                                    <td>{:date('Y-m-d H:i:s',$v.addtime)}</td>
                                    <td>
                                    {switch name="v.status"}
                                    {case value="0"}
                                    <button class="btn btn-danger btn-xs" type="button" onclick="changeTableVal({$v.id},'status',this);"><i class="fa fa-times"></i></button>
                                    {/case}
                                    {case value="1"}
                                    <button class="btn btn-primary btn-xs" type="button" onclick="changeTableVal({$v.id},'status',this);"><i class="fa fa-check"></i></button>
                                    {/case}
                                    {/switch}
                                    </td>
                                    <td>
                                        <button type="button" class="btn btn-primary btn-xs" onclick="editpos({$v.id},this);"><i class="fa fa-pencil"></i>&nbsp;编辑</button>&nbsp;&nbsp;&nbsp;&nbsp;
                                        <button type="button" class="btn btn-danger btn-xs" onclick="delone({$v.id},this);"><i class="fa fa-close"></i>&nbsp;删除</button>
                                    </td>
                                </tr>
							{/foreach}
							{else/}
							<tr><td colspan="6" style="text-align:center; font-size:14px;">没有找到相关数据</td></tr>
							{/if}							
                            </tbody>
                        </table>
                        <div class="row"><div class="pagination" style="float:right; margin-right:20px;">{$page}</div></div>